import initState from '../states/user'
// 导入reducer中处理的数据的方法集合
import mutation from '../mutations/user'

export default (state = initState, action) => {
  try {
    return mutation[action.type](state, action.data)
  } catch (error) {
    return state
  }
}